package com.information.manage.basic.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.information.manage.basic.model.entity.SysRoleDO;
import com.information.manage.basic.model.vo.RoleDepartmentAuthorityVO;
import com.information.manage.basic.model.vo.RoleMenuAuthorityVO;
import com.information.manage.basic.model.vo.SysRoleIdAndNameVO;
import com.information.manage.basic.model.vo.SysRolePageVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysRoleMapper extends BaseMapper<SysRoleDO> {

    /**
     * 查询角色分页
     * @param page
     * @param roleName
     * @param description
     * @return
     */
    Page<SysRolePageVO> findRolePage(Page page, @Param("roleName") String roleName, @Param("description") String description);

    /**
     * 查询角色id对应角色名称
     * @return
     */
    List<SysRoleIdAndNameVO> findRoleIdAndName();

    /**
     * 查询角色部门权限
     * @param roleId 角色id
     * @param typeCollection 类型集 required = true
     * @return
     */
    List<RoleDepartmentAuthorityVO> queryDepartmentByRoleId(@Param("roleId") Integer roleId, @Param("typeCollection") Integer typeCollection);

    /**
     * 查询角色菜单权限
     * @param roleId
     * @return
     */
    List<RoleMenuAuthorityVO> queryMenuByRoleId(Integer roleId);

}
